<template>
  <van-uploader v-model="fileList" :after-read="afterRead" >
  <div class="btn" icon="plus" type="primary" @click="change">自定义上传</div>
  </van-uploader>
  <upload-file>
    <van-button icon="plus" type="primary" @click="change">自定义文件</van-button>
  </upload-file>
</template>
<script setup>
import { ref } from 'vue';
import uploadFile from '@/components/base/upload-file/upload-file.vue'
const fileList = ref([
  { url: 'https://fastly.jsdelivr.net/npm/@vant/assets/leaf.jpeg' },
  // Uploader 根据文件后缀来判断是否为图片文件
  // 如果图片 URL 中不包含类型信息，可以添加 isImage 标记来声明
  { url: 'https://cloud-image', isImage: true },
]);
const change= (e)=>{
  console.log(e);
}
const afterRead = (file) => {
  // 此时可以自行将文件上传至服务器
  console.log(file);
};
</script>
<style>
@media (min-width: 1024px) {
  .about {
    min-height: 100vh;
    display: flex;
    align-items: center;
  }
}
.btn {
  background-color: yellow;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 99999;
}
</style>
